extends Area2D

func _ready() -> void:
	body_entered.connect(on_body_entered)
	var tween = create_tween()
	tween.set_loops()
	tween.set_ease(Tween.EASE_IN_OUT).set_trans(Tween.TRANS_CUBIC)
	tween.tween_property(self,"global_position",global_position+Vector2(0,10),.5)
	tween.tween_property(self,"global_position",global_position+Vector2(0,-10),.5)

func on_body_entered(body: Player) -> void:
	MusicPlayer.play_sfx("ResetDash")
	body.add_dash()
	exit()


func exit() -> void:
	queue_free()
